/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package games;


import java.util.ArrayList;
import java.lang.Integer;
import games.FourInARowState.FourInARowMove;
import java.util.Iterator;
import minmax.GameOutcome;
import minmax.GameState;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Mikael
 */
public class FullColumnTest {
    @Test
    public void FullRow_ShouldNotReturnMoveForThat(){
        /*
            0| | | | | |
            X| | | | | | 
            0| | | | | | 
            X| | | | | | 
            0| | | | | | 
            X|X| | | | | 

         */
        
        FourInARowState state = new FourInARowState();
        state.move(new FourInARowMove(false, 0, 0));
        state.move(new FourInARowMove(true, 0, 1));
        state.move(new FourInARowMove(false, 0, 2));
        state.move(new FourInARowMove(true, 0, 3));
        state.move(new FourInARowMove(false, 0, 4));
        state.move(new FourInARowMove(true, 0, 5));
        state.move(new FourInARowMove(false, 1, 0));
        
        Iterator<FourInARowMove> result = state.moves();
        ArrayList<FourInARowMove> moves = new ArrayList<FourInARowMove>();
        while(result.hasNext()){
            FourInARowMove step = result.next();
            moves.add(step);
            System.out.println(step.toString());
        }
        
        assertEquals(6, moves.size());
        int[] bits = new int[]{8,2,3,4,5,6};
        for (int i = 0; i < moves.size(); i++) {
            
            assertEquals(bits[i], moves.get(i).getBit());
        }
        //assertEquals(0, moves.get(0).);
    }
}
